package com.zsz.service.impl;

import com.zsz.dao.StudentDao;
import com.zsz.doMain.Student;
import com.zsz.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    //引用类型
    private StudentDao studentDao;

    //使用set注入来赋值
    public void setDao(StudentDao dao) {
        this.studentDao = dao;
    }

    @Override
    public int addStudent(Student student) {
        int count=studentDao.insertStudent(student);
        return count;
    }

    @Override
    public List<Student> queryStudnets() {
        List<Student> students=studentDao.selectStudents();
        return students;
    }
}
